package cn.lzj.ymcc.doc;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "course", type = "_doc")

public class CourseDoc {
    @Id
    private Long id;

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String name;
    @Field(type = FieldType.Double)
    private BigDecimal price;
    @Field(type = FieldType.Double)
    private BigDecimal priceOId;

    @Field(type = FieldType.Keyword)
    private String pic;
    @Field(type = FieldType.Long)
    private Long courseTypeId;
    @Field(type = FieldType.Keyword)
    private String gradeName;
    @Field(type = FieldType.Date)
    private Date onlineTime;
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String teacherNames;
    @Field(type = FieldType.Keyword)
    private String chargeName;

    @Field(type = FieldType.Integer)
    private Integer saleCount=0;
    @Field(type = FieldType.Integer)
    private Integer viewCount=0;
    @Field(type = FieldType.Integer)
    private Integer commentCount=0;
}
